package org.ht.demo.openapi.netty;



import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.nio.NioDatagramChannel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


@Component
public class ServerChannelInitializer extends ChannelInitializer<NioDatagramChannel> {
	
	@Autowired
    UDPServerHandler serverChannelHandler;
 
    @Override
    protected void initChannel(NioDatagramChannel nioDatagramChannel) throws Exception {
        ChannelPipeline pipeline = nioDatagramChannel.pipeline();
        //自定义的InboundHandler输入处理者
        pipeline.addLast("serverChannelHandler", serverChannelHandler);
    }


}
